{extends file='layout/main.html'}
{block name="main"}
<div class="main_title">
	<h2>照片列表</h2>
	<p>照片列表及管理照片</p>
</div>

<div class="btn_blk clearfix">
	
	<h1 class="fl large light_gray">
		{foreach array_reverse(get_curm_menu($smarty.get.cid)) as $val}
			{if $val@last}
				<a href="?url=category&id={$val}">{get_info('category',$val,'title')}</a>
			{else}
				<a href="?url=category&id={$val}">{get_info('category',$val,'title')}</a> > 
			{/if}
		{/foreach}
		</h1>
	<div class="fr">
		<a href="#" class="btn2 fr ml20 del_all">删除</a>
		<a href="?url=item/create&cid={$smarty.get.cid}" class="btn1 fr">上传照片</a>
		{if get_category_type($smarty.get.cid)}
		<a href="?url=category/create&id={$smarty.get.cid}" class="btn1 fr">新增专辑</a>
		{/if}
	</div>
</div>
<form action="?url=item/delete" method="post" accept-charset="utf-8" id="res_del">
<ul class="photo_list clearfix">
	
	{foreach $data as $val}
	<li>
    <img src="/Services/images/cropped_200_260/attachments{$val.thum_pic}" width="200" height="260" border="0">
		<p class="pt10">
			<span class="fl ml10"><a href="?url=item/update&id={$val.id}"><img src="{gen_theme_url('images/i.gif')}" class="ico_edit" title="编辑"></a>&nbsp;&nbsp;
			<a href="?url=item/delete&id={$val.id}" class="delete"><img src="{gen_theme_url('images/i.gif')}" class="ico_del" title="删除"></a></span>
			<span class="fr mr10"><input type="checkbox" name="check[]" value="{$val.id}"> 选择</span>
		</p>
	</li>
	{/foreach}

</ul>
</form>
<div class="btn_blk">
	<div class="fr">
			<a href="#" class="btn2 fr ml20 del_all">删除</a>
			<a href="?url=item/create&cid={$smarty.get.cid}" class="btn1 fr">上传照片</a>
			{if get_category_type($smarty.get.cid)}
			<a href="?url=category/create&id={$smarty.get.cid}" class="btn1 fr">新增专辑</a>
			{/if}
		{include file="lib/pager.html"}
	</div>

</div>
<script type="text/javascript" charset="utf-8">
$('.del_all').click(function(){
	var check = $(":checkbox:checked").size();
	if (!check) {
		alert('你还没有选择要删除的用户');
		return false;
	};
	$("#res_del").submit();
  return false;
});
</script>
{/block}